package com.hqyj.javaSpringBoot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication//启动注解
@ServletComponentScan//启动servlet组件扫描
public class JavaSpringBootApplication extends SpringBootServletInitializer {
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        //指定入口让外置的tomcat找到入口执行war包，解决项目没有xml配置文件问题
        return builder.sources(JavaSpringBootApplication.class);

    }

    public static void main(String[] args) {
        SpringApplication.run(JavaSpringBootApplication.class, args);
    }

}
